package com.baizhi.service.impl;

import com.baizhi.dao.CelebrityDao;
import com.baizhi.entity.Celebrity;
import com.baizhi.service.CelebrityService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class CelebrityServiceImpl implements CelebrityService {
    @Autowired
    private CelebrityDao celebrityDao;
    public void setCelebrityDao(CelebrityDao celebrityDao) {
        this.celebrityDao = celebrityDao;
    }

    @Override
    public List<Celebrity> selectCelebrities(Integer pageNum, Integer pageSize) {
        return celebrityDao.selectCelebrities(pageNum,pageSize);
    }

    @Override
    public Celebrity selectCelebrityById(Integer id) {
        return celebrityDao.selectCelebrityById(id);
    }

    @Override
    public void insertCelebrity(Celebrity c) {
      celebrityDao.insertCelebrity(c);
    }

    @Override
    public void deleteCelebrityById(Integer id) {
       celebrityDao.deleteCelebrityById(id);
    }

    @Override
    public void updateCelebrity(Celebrity c) {
       celebrityDao.updateCelebrity(c);

    }
}
